import { Injectable } from '@angular/core';
import { NzModalService } from 'ng-zorro-antd';

@Injectable({
  providedIn: 'root'
})
export class OprationService {

  ossUri: string = 'https://gzysjkj-live.oss-cn-shenzhen.aliyuncs.com/';

  constructor(
    private modalService: NzModalService
  ) { }

  tips(result: any, message?: string) {
    if (result['code'] == 'success') {
      if (message) {
        this.modalService.success({
          nzTitle: '信息提示',
          nzContent: message,
          nzClosable: false
        });
      }
    }
    else {
      this.modalService.error({
        nzTitle: '操作失败',
        nzContent: result['message'].join('<br />'),
        nzClosable: false
      });
    }
  }
}
